package com.aspose.cells;

class zbn extends zbz {
   zbn(Axis var1) {
      this.c(4194);
      this.b(18);
      this.c = new byte[18];
      this.c[4] = 1;
      this.c[8] = 1;
      this.c[16] = -17;
      boolean var2 = var1.a().j().n().getSettings().getDate1904();
      boolean var3 = false;
      if (var1.getCategoryType() == 2) {
         this.c[16] = (byte)(this.c[16] | 16);
         if (!var1.isBaseUnitAuto()) {
            this.c[16] = (byte)(this.c[16] & 223);
            var3 = var1.getBaseUnitScale() != 0;
         }

         switch(var1.getBaseUnitScale()) {
         case 0:
         default:
            break;
         case 1:
            this.c[12] = 1;
            break;
         case 2:
            this.c[12] = 2;
         }
      }

      if (!var1.g()) {
         this.c[16] = (byte)(this.c[16] & 251);
         if (var1.getCategoryType() == 2 || var1.getCategoryType() == 0) {
            switch(var1.getMajorUnitScale()) {
            case 0:
            default:
               break;
            case 1:
               this.c[6] = 1;
               break;
            case 2:
               this.c[6] = 2;
            }
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var1.getMajorUnit()), 0, this.c, 4, 2);
      }

      if (!var1.h()) {
         this.c[16] = (byte)(this.c[16] & 247);
         if (var1.getCategoryType() == 2 || var1.getCategoryType() == 0) {
            switch(var1.getMinorUnitScale()) {
            case 0:
            default:
               break;
            case 1:
               this.c[10] = 1;
               break;
            case 2:
               this.c[10] = 2;
            }
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var1.getMinorUnit()), 0, this.c, 8, 2);
      }

      double var4;
      if (!var1.e()) {
         this.c[16] = (byte)(this.c[16] & 254);
         var4 = this.a(var1.getMinValue(), var3, var1.getBaseUnitScale(), var2);
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var4), 0, this.c, 0, 2);
      }

      if (!var1.f()) {
         this.c[16] = (byte)(this.c[16] & 253);
         var4 = this.a(var1.getMaxValue(), var3, var1.getBaseUnitScale(), var2);
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var4), 0, this.c, 2, 2);
      }

      if (var1.getCategoryType() != 0) {
         this.c[16] = (byte)(this.c[16] & 127);
      }

      if (var1.getCrossType() == 2) {
         this.c[16] = (byte)(this.c[16] & 191);
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)var1.getCrossAt()), 0, this.c, 14, 2);
      }

      if (var1.f) {
         this.c[16] = (byte)(this.c[16] | 64);
      }

   }

   double a(Object var1, boolean var2, int var3, boolean var4) {
      double var5 = 0.0D;
      if (var2) {
         if (var1 instanceof Double) {
            var5 = this.a((Double)var1, var3, var4);
         } else {
            var5 = this.a((DateTime)var1, var3, var4);
         }
      } else if (var1 instanceof Double) {
         var5 = (Double)var1;
      } else {
         var5 = CellsHelper.getDoubleFromDateTime((DateTime)var1, var4);
      }

      return var5;
   }

   double a(DateTime var1, int var2, boolean var3) {
      switch(var2) {
      case 1:
         return (double)((var1.getYear() - (var3 ? 1904 : 1900)) * 12 + var1.getMonth() - 1);
      case 2:
         return (double)(var1.getYear() - (var3 ? 1904 : 1900));
      default:
         return CellsHelper.getDoubleFromDateTime(var1, var3);
      }
   }

   double a(double var1, int var3, boolean var4) {
      DateTime var5;
      switch(var3) {
      case 1:
         var5 = CellsHelper.getDateTimeFromDouble(var1, var4);
         return (double)((var5.getYear() - (var4 ? 1904 : 1900)) * 12 + var5.getMonth() - 1);
      case 2:
         var5 = CellsHelper.getDateTimeFromDouble(var1, var4);
         return (double)(var5.getYear() - (var4 ? 1904 : 1900));
      default:
         return var1;
      }
   }
}
